<%@ page language="java" import="java.util.*" pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

		<table class="tableForm datagrid-toolbar" style="width: 100%;height: 10%;">
			<tr>
				<td class="guide" height="20px">&nbsp;
					<img src="${pageContext.request.contextPath}/images/blocks.gif" align="absmiddle">
					个人设置--&gt;个人信息
				</td>				
			</tr>
			<tr>
				<td height="2"></td>
			</tr>
			<tr>
				<td height="1" class="COLOR1B"></td>
			</tr>
		</table>
		<table class="tableForm datagrid-toolbar" style="width: 100%;height: 10%;">
			<tr valign="top">
				<td width="80%">
					<table id="head" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td id="head_R"></td>
							<td>
								个人信息
							</td>
						</tr>
					</table>
					<table class="tableForm datagrid-toolbar" style="width: 100%;height: 100%;">
						<tr>
							<td valign="top" align="center">
							<TABLE id="table2" cellSpacing=1 cellPadding=0 border=0>
								<TBODY>
									<TR>
										<TD id="td_title" width="100px" height="25px">
											用户名称：
										</TD>
										<TD width="300px" height="25px" id="td_context">
											<SPAN id=FormViewDept_IdLabel>${sessionScope.user.user}
											</SPAN>&nbsp;
										</TD>
									</TR>
									<TR>
										<TD id="td_title" height="25px">
											用户姓名：
										</TD>
										<TD id="td_context">
											<SPAN id=FormViewDept_SNameLabel>${sessionScope.user.name}
											</SPAN>&nbsp;
										</TD>
									</TR>
											<TR>
												<TD id="td_title" width="100px" height="25px">
													用户密码：
												</TD>
												<TD id="td_context">
													<SPAN id=FormViewDept_SDeptKindLabel>****** </SPAN>&nbsp;
												</TD>
											</TR>
											<TR>
												<TD id="td_title" width="100px" height="25px">
													电话：
												</TD>
												<TD id="td_context">
													<SPAN id=FormViewDept_SAddressLabel>${sessionScope.user.telephone}
													</SPAN>&nbsp;
												</TD>
											</TR>
											<TR>
												<TD id="td_title" width="100px" height="25px">
													手机：
												</TD>
												<TD id="td_context">
													<SPAN id=FormViewDept_SPostCodeLabel>${sessionScope.user.cellphone }
													</SPAN>&nbsp;
												</TD>
											</TR>
											
											<TR>
												<TD id="td_title" width="100px" height="25px">
													注册时间：
												</TD>
												<TD id="td_context">
													<SPAN id=FormViewDept_SPostCodeLabel><s:date name="%{#session.user.createTime}" format="yy-MM-dd"/>
													</SPAN>&nbsp;
												</TD>
											</TR>
											<tr>
												<td colspan=2 align=center>
													<input type="submit"  onclick="Open_Dialog1()" value="&nbsp;编 辑&nbsp;">
												</td>
											</tr>
											
										</TBODY>
							</TABLE></TD>		
						</tr>
					</table>
				</td>
			</tr>
		</table>
		
		
		<div id="mydialog1"  icon="icon-save"  style="width: 300px; height: auto; padding: 5px; display:none;
        background: #fafafa;" title="用户信息修改">

            <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
                <table cellpadding=3>
                    <tr>
                        <td>用户名称：</td>
                        <td><input  value="${sessionScope.user.user}"   name="user" readonly="readonly"/></td>
                    </tr>
                    <tr>
                        <td>用户姓名：</td>
                        <td><input   id="txtName"  value="${sessionScope.user.name}"  /></td>
                    </tr>
                    
               			<TR>
							<TD>
								电话：
							</TD>
							<TD >
								<input id="txtTelephone" value="${sessionScope.user.telephone}"/>
							</TD>
						</TR>
						<TR>
							<TD>
								手机：
							</TD>
							<TD >
								<input id="txtCellphone" value="${sessionScope.user.cellphone }"/>
							</TD>
						</TR>
                </table>
            </div>

											

		

<label id="lbmsg" runat="server"></label>
</div> 

    <script type="text/javascript" charset="utf-8">
		function Open_Dialog1() {
			$('#mydialog1').show();
				$('#mydialog1').dialog({
					collapsible: true,
					minimizable: true,
					maximizable: true,
					
				buttons: [{
					text: '提交',
					iconCls: 'icon-ok',
					handler: function() {
					serverLogin();
				}
				}, {
					text: '取消',
					handler: function() {
					$('#mydialog1').dialog('close');
					}
				}]
			});
		} 
		
	//关闭修改密码窗口
        function close1() {
           $('#mydialog1').dialog('close');
        }
		 //修改密码
        function serverLogin() {
        	var $name = $('#txtName');
            var $telephone = $('#txtTelephone');
             var $cellphone = $('#txtCellphone');
            $.post('${pageContext.request.contextPath}/tuserAction!updateMsg.action?name=' + $name.val()+'&telephone='+$telephone.val()+'&cellphone='+$cellphone.val(), function(msg) {
               var j = jQuery.parseJSON(msg); 
				if(j&&j.success){
					$.messager.show({
						msg:j.msg,
						title:'提示'
					});
				}else{
						$.messager.alert('提示',j.msg,'warning');
				}
                close1();
            })
            
        }
    </script>